fix: Use 'fallback simulator' for tvOS #2608
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
👋, I am working on adding OOT (Out-of-tree) CLI support to
react-native-tvos
. The update went well, and the OOT will soon havebuild-
,run-
, andlog-
commands for tvos.However, the wrong simulator is selected.
This bug is unique to the tvos platform. When passing the
--simulator
parameter, the first device is always chosen, and the simulator parameter is ignored.tl;dr
The wrong simulator is selected when the platform is tvos.
Test Plan
While the fix is straightforward, testing takes a little setup. I created a sample RNTV project for testing and validating this change.
Pre-requisites
Xcode is installed, and at least two simulators are installed. The trick to reproducing the issue is to select a simulator that is not first in the device list.
In this example, I have two simulators installed and one device connected:
(order from --list-devices)
I will try to run the app on the Apple TV (17.0) simulator.
Step to reproduce
Expected
info Launching Apple TV (tvOS 17.0)
Actual
info Launching Office (18.3 (22K557))
Testing the FIX
We'll continue and test the fix by rerunning
yarn
with the patched file.After the patch, the correct simulator, Apple TV (tvOS 17.0), was selected.
Checklist
react-native
checkout (instructions).